﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" 
Inherits="System.Web.Mvc.ViewPage<IEnumerable<iBuproModel.User>>" %>
<%@ Import Namespace="IBupro.Extensions" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table class="projects tablesorter">
    <thead>
        <tr>
            <th></th>
            <th>
                Příjmení
            </th>
            <th>
                Křestní jméno
            </th>
            <th>
                Uživatelské jméno
            </th>
            <th>
                Email
            </th>
            <th>
                Role
            </th>
        </tr>
    </thead>

    <tbody>
    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink(Html.Translate("edit"), "Edit", new { id = item.Id })%> |
                <%: Html.ActionLink(Html.Translate("editRoles"), "EditRoles", new { id = item.Id })%> |
                <a href="<%= Url.UserDetailsUrl(item) %>">Details</a>
            </td>
            <td>
                <%: item.LastName %>
            </td>
            <td>
                <%: item.FirstName %>
            </td>
            <td>
                <%: item.Username %>
            </td>
            <td>
                <% if (!item.Email.Equals(null)) { %>
                    <a href="mailto:<%: item.Email %>"><%: item.Email %></a>
                <% } %>
            </td>
            <td>
                <% foreach (var role in item.Roles) { %>
                    <%: role.Name %>
                <% } %>
            </td>
        </tr>
    
    <% } %>
    </tbody>
    </table>

    <script type="text/javascript">
        /*
        $(document).ready(function () {
        $("table")
        .tablesorter({ widthFixed: true, widgets: ['zebra'] })
        .tablesorterPager({ container: $("#pager") });
        });
        */ 
    </script>

</asp:Content>

